<template>
    <view class="page-body">
        <view class="info-img-box">
            <image src="../../static/ibs/img_comm_authorize.png" mode=""></image>
        </view>
        <view class="info-text-box">
            <view class="info-text-f34">小程序未授权</view>
            <view class="info-text-f32">无法查看大量的求购信息</view>
        </view>
        <view class="info-btn-box">
            <button type="primary" open-type="getUserInfo" @getuserinfo="bindGetUserInfo">立即授权</button>
        </view>


    </view>
</template>

<script>

    export default {
        data() {
            return {};
        },

        methods: {
            //open-type 的回调方法
            bindGetUserInfo(e) {
                let that = this;
                //调用获取微信及用户信息方法
                that.getUserInfo().then(res => {
                    //如果获取成功，跳转到首页列表
					if(res){
						 uni.switchTab({
						    url: '/pages/demand/index'
						});
					}else{
						uni.showToast({
							title: '系统需授权才能使用!',
							icon: 'none',
							duration: 2000
						});
					}

                });
            },
        }
    }
</script>

<style>
    .page-body {
        background: #FFFFFF;
        width: 100vw;
        min-height: 100vh;
    }

    .info-img-box {
        border-top: #E5E5E5 1upx solid;
        padding-top: 210upx;
        display: flex;
        justify-content: center;
    }

    .info-img-box image {
        width: 85upx;
        height: 100upx;
    }

    .info-text-box {
        text-align: center;

    }

    .info-text-f34 {
        padding-top: 34upx;
        font-size: 34upx;
        color: #1A1A1A;
        height: 34upx;
        line-height: 34upx;
        font-weight: bold;
    }

    .info-text-f32 {
        font-size: 32upx;
        color: #4C4C4C;
        padding-top: 28upx;
        height: 32upx;
        line-height: 32upx;
    }

    .info-btn-box {
        padding-top: 50upx;

    }

    .info-btn-box button {
        width: 580upx;
        background: #077131;
        height: 88upx;
        line-height: 88upx;
        color: #FFFFFF;
        border-radius: 44upx;

    }
</style>
